﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EstateEdit.ascx.cs"
    Inherits="ZF.WS.UserControls.EstateEdit" %>
<%@ Register Src="/UserControls/SWFUpLoad.ascx" TagName="SWFUpLoad" TagPrefix="uc1" %>
<link href="/css/validator.css" rel="stylesheet" type="text/css" />

<script language="javascript" type="text/javascript" src="/js/jqPlugins/jquery.json-2.2.min.js"></script>

<script src="/js/formValidator.js" type="text/javascript" language="javascript"></script>

<script src="/js/formValidatorRegex.js" type="text/javascript" language="javascript"></script>

<script src="/js/jqPlugins/onlypressnum.js" type="text/javascript" language="javascript"></script>

<script>
    var citystr = '<%=Newtonsoft.Json.JsonConvert.SerializeObject(ZF.BLL.DictionaryConfig.HAreaTree)%>';
</script>

<script src="/js/zfinput.js" type="text/javascript" language="javascript"></script>

<script>

    $(function() {

        $.formValidator.initConfig({ formid: document.forms[0].id, onerror: function(msg) { alert(msg) } });

        $(".tbTitle").formValidator({ tipid: "tbTitleTip", onshow: "(20字以内。请准确填写物业或小区名称。)", onfocus: "(20字以内。请准确填写物业或小区名称。)", oncorrect: " ", onempty: "(20字以内。请准确填写物业或小区名称。)" })
    .inputValidator({ min: 1, onerror: "输入错误：必须输入物业或小区名称" })
    .inputValidator({ max: 40, onerror: "输入错误：物业或小区名称不能超过20个字" });
        $(".tbAddress").formValidator({ tipid: "tbAddressTip", onshow: "( 字数限制40个)", onfocus: "( 字数限制40个)", oncorrect: " ", onempty: "( 字数限制40个)" })
    .inputValidator({ min: 1, onerror: "输入错误：必须输入物业地址" })
    .inputValidator({ max: 80, onerror: "输入错误：物业地址不能超过40个字" });
        $(".tbTopNum").onlypressnum();

        $(".tbContact").formValidator({ tipid: "tbContactTip", onshow: "( 如王先生)", onfocus: "( 如王先生)", oncorrect: " ", onempty: "( 如王先生)" })
    .inputValidator({ min: 1, onerror: "输入错误：必须输入联系人" });

        $(".tbPhone").formValidator({ tipid: "tbPhoneTip", onshow: "( 固话号码或手机号码，如果有多个用“，”分隔)", onfocus: "( 固话号码或手机号码，如果有多个用“，”分隔)", oncorrect: " ", onempty: "(  固话号码或手机号码，如果有多个用“，”分隔)" })
    .inputValidator({ min: 1, onerror: "输入错误：请至少输入一个联系电话" });

        $(".tbQQ").onlypressnum();

//        $(".tbDescription").formValidator({ tipid: "tbDescriptionTip", onshow: " ", onfocus: " ", oncorrect: " ", onempty: " " })
//    .inputValidator({ max: 400, onerror: "输入错误：输入字符不能超过200个" });

        $(".tbConstructArea").onlypressnum();
        $(".tbUserArea").onlypressnum();

        //            $(".tbPubEmail").formValidator({ tipid: "tbPubEmailTip", onshow: " ", onfocus: " ", oncorrect: " ", onempty: "" })
        //    .regexValidator({ regexp: "email", datatype: "enum", onerror: "格式错误" });

    });
    
    
</script>

<script>
    $(function() {
        $(".tbUnitPrice").onlypressnum();
        $(".tbUnitPrice").formValidator({ tipid: "tbUnitPriceTip", onshow: " ", onfocus: " ", oncorrect: " ", onempty: " " })
    .inputValidator({ min: 1, onerror: " " });

    });
</script>

<script>
    $(function() {
        $(".tbSFPrice").onlypressnum();
        $(".tbSFPrice").formValidator({ tipid: "tbSFPriceTip", onshow: "(万元/套)", onfocus: "(万元/套)", oncorrect: " ", onempty: "(万元/套)" })
    .inputValidator({ min: 1, onerror: "输入错误：请输入售价" });
        $(".tbUnitPrice").onlypressnum();

    });
</script>

<div class="editContainer">
    <table class=" w100_  edit ">
        <zf:TextBox ID="tbCity" class="dn_" Text="149" runat="server"></zf:TextBox>
        <zf:TextBox ID="tbArea" class="dn_" Text="153" runat="server"></zf:TextBox>
        <tbody>
            <tr>
                <th colspan="4">
                    <div class="c ">
                        楼盘信息设置
                         <zf:CheckBox runat="server" ID="cbJp"  Text="精品楼盘" />
                        
                    </div>
                </th>
            </tr>
            <tr>
                <td class="ll">
                    <div class="c">
                        <span class="xh_"></span>范 围：
                    </div>
                </td>
                <td class="lr" colspan="3">
                    <div class="c">
                        <input type="radio" checked="checked" value="1" id="areagz" name="areaType" /><label
                            for="areagz">广州地区</label>
                        <input type="radio" value="2" id="areagd" name="areaType" /><label for="areagd">省内城市</label>
                    </div>
                </td>
            </tr> 
            <tr>
                <td class="ll">
                    <div class="c">
                        <span class="xh_">*</span>
                    <span  class="spCity">区域</span>：
                </td>
                <td class="lr" colspan="3">
                    <div class="c">
                        <select id="selCity" style="width: 100px;" class="mr10_">
                        </select>
                        <span id="spSQ"><span   class="spArea">商圈</span>：<select id="selArea" class="ml10_" style="width: 100px;"></select></span>
                        <span class="zx_ dn_" id="Span1"></span>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="ll">
                    <div class="c">
                        <span class="xh_">*</span>物业或小区名称
                    </div>
                </td>
                <td class="lr" colspan="3">
                    <div class="c">
                        <zf:TextBox runat="server" ID="tbTitle" class="txt"></zf:TextBox>
                        <span class="zx_" id="tbTitleTip"></span>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="ll">
                    <div class="c">
                        <span class="xh_">*</span>物业地址：
                    </div>
                </td>
                <td class="lr" colspan="3">
                    <div class="c">
                        <zf:TextBox runat="server" ID="tbAddress" class="ltxt"></zf:TextBox>
                        <span class="zx_" id="tbAddressTip">40个字以内</span>
                    </div>
                </td>
            </tr>
           
            <tr>
                <td class="rl">
                    <div class="c">
                        <span class="xh_">*</span>单 价：
                    </div>
                </td>
                <td class="rr">
                    <div class="c">
                        <zf:TextBox runat="server" ID="tbUnitPrice" class="stxt"></zf:TextBox>
                        <span  id="tbUnitPriceTip"></span>
                        <span class="zx_">元/平方米</span>
                        
                    </div>
                </td>
                <td class="ll">
                    <div class="c">
                        <span class="xh_">*</span>物业类型：
                    </div>
                </td>
                <td class="lr">
                    <div class="c">
                        <zf:DropDownList ID="ddlHouseType" runat="server" class="ddl">
                        </zf:DropDownList>
                    </div>
                </td>
            </tr>
             <tr>
                <td class="ll">
                    <div class="c">
                        <span class="xh_"></span>占地面积：
                    </div>
                </td>
                <td class="lr">
                    <div class="c">
                        <zf:TextBox runat="server" ID="tbUserArea" class="sstxt"></zf:TextBox><span class="zx_"
                            id="Span3">平米</span>
                    </div>
                </td>
                <td class="rl">
                    <div class="c">
                        <span class="xh_"></span>建筑面积：
                    </div>
                </td>
                <td class="rr">
                    <div class="c">
                        <zf:TextBox runat="server" ID="tbConstructArea" class="sstxt"></zf:TextBox>
                        <span class="zx_" id="Span2">平米</span>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="rl">
                    <div class="c">
                        <span class="xh_"></span>交通状况：
                    </div>
                </td>
                <td class="rr" colspan="3">
                    <div class="c">
                        <zf:TextBox runat="server" ID="tbTraffic" class="ltxt"></zf:TextBox>
                        <span class="zx_" id="Span7">（请说明附近的交通情况如:公交线路或者地铁）</span>
                    </div>
                </td>
            </tr>
            <tr>
             <td class="ll">
                    <div class="c">
                        <span class="xh_"></span>售房办理地址：
                    </div>
                </td>
                <td class="lr"  >
                    <div class="c">
                        <zf:TextBox runat="server" ID="tbOffice" class="ltxt"></zf:TextBox>
                        <span class="zx_" id="Span4"></span>
                    </div>
                </td>
                 <td class="ll">
                    <div class="c">
                        <span class="xh_"></span>开盘日期：
                    </div>
                </td>
                <td class="lr">
                    <div class="c">
                        <zf:TextBox runat="server" ID="tbSaleDate" class="stxt" onfocus="calendar();"></zf:TextBox>
                        <img  src="/images/calendar.gif" onclick="calendar($('.tbSaleDate')[0]);" class="cp_" />
                        <span class="zx_" id="Span11"></span>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="ll">
                    <div class="c">
                        <span class="xh_"></span>售盘电话：
                    </div>
                </td>
                <td class="lr">
                    <div class="c">
                        <zf:TextBox runat="server" ID="tbTel" class="stxt"></zf:TextBox>
                        <span class="zx_" id="Span5">如:020-83643158</span>
                    </div>
                </td>
                <td class="ll">
                    <div class="c">
                        <span class="xh_"></span>开发商：
                    </div>
                </td>
                <td class="lr">
                    <div class="c">
                        <zf:TextBox runat="server" ID="tbDevelopers" class="stxt"></zf:TextBox>
                        <span class="zx_" id="Span6"></span>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="ll">
                    <div class="c">
                        <span class="xh_"></span>销售证：
                    </div>
                </td>
                <td class="lr">
                    <div class="c">
                        <zf:TextBox runat="server" ID="tbPaperwork" class="stxt"></zf:TextBox>
                        <span class="zx_" id="Span9"></span>
                    </div>
                </td>
                <td class="ll">
                    <div class="c">
                        <span class="xh_"></span>开发商网址：
                    </div>
                </td>
                <td class="lr" colspan="3">
                    <div class="c">
                        <zf:TextBox runat="server" ID="tbDevUrl" class="txt"></zf:TextBox>
                        <span class="zx_" id="Span8">如:http://www.baidu.com </span>
                    </div>
                </td>
            </tr>
          
            <tr>
                <td class="ll">
                    <div class="c">
                        <span class="xh_"></span>详细说明
                    </div>
                </td>
                <td class="lr" colspan="3">
                    <div class="c">
                        <zf:TextBox runat="server" ID="tbDescription" TextMode="MultiLine" class="mstxt"  style="width:80%"></zf:TextBox>
                        <span class="zx_" id="tbDescriptionTip"></span>
                    </div>
                </td>
            </tr>
        </tbody>
        <tbody>
            <tr>
                <th colspan="4">
                    <div class="c">
                        上传图片：最多可上传5张图片</div>
                </th>
                <tr>
                    <td class="ll">
                        <div class="c vam_">
                            <span class="xh_"></span>图片上传：
                        </div>
                    </td>
                    <td class="lr" colspan="3">
                        <div class="c">
                            <uc1:swfupload id="SWFUpLoad1" runat="server" uploadurl="/uploadfile.aspx?type=house"
                                filelimit="5" maxsize="500" filetype="*.gif;*.jpg" />
                            <zf:PlaceHolder ID="PlaceHolder1" runat="server" BindOper="Edit">
                                <zf:TextBox runat="server" ID="tbPhoto" class="dn_"></zf:TextBox>
                                <style>
                                    .ulimg li { float: left; width: 100px; margin-right: 10px; text-align: center; }
                                    .ulimg li img { width: 100px; height: 100px; }
                                </style>
                                <div class="ulimg">
                                    <zf:ListView runat="server" ID="lvImgList">
                                        <LayoutTemplate>
                                            <ul>
                                                <zf:PlaceHolder ID="itemPlaceHolder" runat="server">
                                                </zf:PlaceHolder>
                                            </ul>
                                        </LayoutTemplate>
                                        <ItemTemplate>
                                            <li>
                                                <img src="/photo/house/<%#Eval("File") %>" />
                                                <input type="button" onclick="DelPhoto(this,'<%#Eval("File") %>')" value="删除图片" />
                                            </li>
                                        </ItemTemplate>
                                    </zf:ListView>
                                </div>

                                <script>

                                    function DelPhoto(obj, file) {
                                        var result = $(".tbPhoto").val().replace(file, "");
                                        $(".tbPhoto").val(result);
                                        $(obj.parentNode).remove();
                                    }
                                </script>

                            </zf:PlaceHolder>
                        </div>
                    </td>
                </tr>
            </tr>
        </tbody>
        <%--<tbody>
            <tr>
                <th colspan="4">
                    <div class="c">
                        联系人资料
                    </div>
                </th>
            </tr>
            <tr>
                <td class="ll">
                    <div class="c">
                        <span class="xh_">*</span>联系人：
                    </div>
                </td>
                <td class="lr">
                    <div class="c">
                        <zf:TextBox runat="server" ID="tbContact" class="stxt"></zf:TextBox>
                        <span class="zx_" id="tbContactTip"></span>
                    </div>
                </td>
                <td class="rl">
                    <div class="c">
                        <span class="xh_"></span>Q Q：
                    </div>
                </td>
                <td class="rr">
                    <div class="c">
                        <zf:TextBox runat="server" ID="tbQQ" class="stxt"></zf:TextBox>
                        <span class="zx_" id="Span10">（客户可以直接通过QQ与你取得联系）</span>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="ll">
                    <div class="c">
                        <span class="xh_">*</span>联系电话：
                    </div>
                </td>
                <td class="lr"  colspan="3">
                    <div class="c">
                        <zf:TextBox runat="server" ID="tbPhone" class="ltxt"></zf:TextBox>
                        <span class="zx_" id="tbPhoneTip"></span>
                    </div>
                </td>
                
            </tr>
            <tr>
            <td class="ll">
                    <div class="c">
                        <span class="xh_"></span>联系EMAIL：
                    </div>
                </td>
                <td class="lr" colspan="3">
                    <div class="c">
                        <zf:TextBox runat="server" ID="tbPubEmail" Text="" class="txt"></zf:TextBox>
                        <span class="zx_" id="tbPubEmailTip">（如：abc123@163.com）</span>
                    </div>
                </td>
            </tr>
        </tbody>--%>
        <tbody>
            <tr class="b">
                <td colspan="4">
                    <div>
                        <zf:Button BindOper="AddNew" ID="btAdd" class="linkbtn addSubmit" runat="server"
                            Text=" 发 布 " OnClick="AddSubmit"></zf:Button>
                        <zf:Button BindOper="Edit" ID="btEdit" class="linkbtn" runat="server" Text=" 修 改 "
                            OnClick="EditSubmit"></zf:Button>
                        <input type="button" class="linkbtn" value=" 取 消 " onclick="GoBack();" />
                    </div>
                </td>
            </tr>
        </tbody>
    </table>
</div>
